<!DOCTYPE html>
<html>
<head>
    <title>分页查询</title>
</head>
<body>
    <table>
        <thead>
            <tr>
                <th>ID</th>
                <th>名称</th>
            </tr>
        </thead>
        <tbody>
            {% for user in users.items %}
            <tr>
                <td>{{ user.id }}</td>
                <td>{{ user.name }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% if users.has_prev %}
        <a href="{{ url_for('index', page=users.prev_num) }}">上一页</a>
    {% endif %}

    {% if users.has_next %}
        <a href="{{ url_for('index', page=users.next_num) }}">下一页</a>
    {% endif %}
</body>
</html>